package dongshi.daddy.main;

import dongshi.daddy.service.scopelocal.ScopeLocalService;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class MyProviderScopeLocalMain {
    public static void main(String[] args) throws Exception {
        //加载xml配置文件启动
        ClassPathXmlApplicationContext providerContext = new ClassPathXmlApplicationContext("META-INF/spring/scopelocal/provider-scope-local.xml");
        providerContext.start();
                ClassPathXmlApplicationContext consumerContext = new ClassPathXmlApplicationContext("META-INF/spring/scopelocal/consumer-scope-local.xml");

        consumerContext.start();

        ScopeLocalService scopeLocalService = consumerContext.getBean("scopeLocalService", ScopeLocalService.class);
        scopeLocalService.sayHi("hello scope local!");
        System.in.read(); // 按任意键退出
    }
}
